package com.jr.controller;

import org.apache.log4j.Logger;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;


@WebServlet("/mc")
public class MainController extends HttpServlet {


    private static final Logger log = Logger.getLogger(MainController.class.getName());

    @Override
    protected void service(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
            super.service(req, resp);
    }

    @Override
    protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        log.info("请求到达Maincontroller类的toget方法");
        String k = req.getParameter("k");
        log.debug("查看k值:" + k);
        try {
            int i = Integer.parseInt(k);
        } catch (Exception e) {
            log.error("k的值是null，不能进行类型转换");
        }
    }
}
